<template>
  <div class="form-autograph">
    <div :id="`form_${field.fieldName}`" class="form-item__text">{{$t('common.form.tip.autogaph.tips1')}}</div>
  </div>
</template>

<script>
import FormMixin from '@src/component/form/mixin/form';

export default {
  name: 'form-autograph',
  mixins: [FormMixin],
  props: {
    field: {
      type: Object,
      default: () => ({})
    },
    value: {
      type: [String, Object],
      default: () => ({})
    }
  },
  methods: {
    input(event){
      let oldValue = null;
      let newValue = event.target.value;
      if (newValue === '') {
        this.$nextTick(() => {
          event.target.value = '';
        });
      }
      this.$emit('update', {newValue, oldValue, field: this.field});
      this.$emit('input', newValue);
    }
  }
}
</script>

<style lang="scss" scoped>
.form-autograph{
  border: 1px solid #D9D9D9;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
    .form-item__text{
      width: 100%;
      background-color: #F5F5F5;
      padding: 3px 5px;
      color: #BFBFBF;
  }
}
</style>